
 <!DOCTYPE HTML>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  
    <title>Docker安装JavaWeb(Tomcat)运行环境 | wustrive&#39;s blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1">
    
    <meta name="author" content="wustrive">
    
    <meta name="description" content="docker 安装条件：

开通cpu虚拟化技术 BIOS设置
宿主主机要求64位操作系统

测试环境：ubuntu 14.04 64bit
安装docker
安装最新版本的docker
 wget -qO- https://get.docker.com/ | sh

查看版本
 doceker v">
    
    
    
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="wustrive" />
    <meta name="twitter:title" content="Docker安装JavaWeb(Tomcat)运行环境 | wustrive&#39;s blog" />
      
    
    
    <link rel="alternate" href="/atom.xml" title="wustrive&#39;s blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/logo.ico">
    <link rel="apple-touch-icon-precomposed" href="/img/logo.ico">
    
    <link rel="stylesheet" href="/css/style.css">
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?5829c94e2ff91660826b6c0c188f5620";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>

</head>

  <body>
    <header>
      <div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="wustrive&#39;s blog" title="wustrive&#39;s blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="wustrive&#39;s blog">wustrive&#39;s blog</a></h1>
				<h2 class="blog-motto">好记性不如写博客</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
			</a></div>
			<nav class="animated">
				<ul>
					
						<li><a href="/">主页</a></li>
					
						<li><a href="/archives">归档</a></li>
					
						<li><a href="/aboutme">关于</a></li>
					
					<li>
					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="text" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
						<input type="hidden" name="q" value="site:wustrive2008.github.io">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>

    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2015/07/26/Docker安装JavaWeb(Tomcat)运行环境/" title="Docker安装JavaWeb(Tomcat)运行环境" itemprop="url">Docker安装JavaWeb(Tomcat)运行环境</a>
  </h1>
  <p class="article-author">By
    
      <a href="https://wustrive2008.github.io" title="wustrive">wustrive</a>
    </p>
  <p class="article-time">
    <time datetime="2015-07-26T13:43:05.000Z" itemprop="datePublished">2015-07-26</time>
    更新日期:<time datetime="2016-11-05T18:14:33.000Z" itemprop="dateModified">2016-11-06</time>
    
  </p>
</header>
	<div class="article-content">
		
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">文章目录</strong>
		<ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装docker"><span class="toc-number">1.</span> <span class="toc-text">安装docker</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#去除掉sudo"><span class="toc-number">2.</span> <span class="toc-text">去除掉sudo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#安装docker镜像"><span class="toc-number">3.</span> <span class="toc-text">安装docker镜像</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#虚拟机环境部署"><span class="toc-number">4.</span> <span class="toc-text">虚拟机环境部署</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#docker常用命令"><span class="toc-number">5.</span> <span class="toc-text">docker常用命令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#常见问题"><span class="toc-number">6.</span> <span class="toc-text">常见问题</span></a></li></ol>
		</div>
		
		<p>docker 安装条件：</p>
<ol>
<li>开通cpu虚拟化技术 BIOS设置</li>
<li>宿主主机要求64位操作系统</li>
</ol>
<p>测试环境：ubuntu 14.04 64bit</p>
<h3 id="安装docker">安装docker</h3><ol>
<li><p>安装最新版本的docker</p>
<p> <code>wget -qO- https://get.docker.com/ | sh</code></p>
</li>
<li><p>查看版本</p>
<p> <code>doceker vresion</code></p>
</li>
<li><p>运行测试</p>
<p> <code>docker run hello-world</code></p>
</li>
</ol>
<h3 id="去除掉sudo">去除掉sudo</h3><blockquote>
<p>在Ubuntu下，在执行Docker时，每次都要输入sudo，同时输入密码，很累人的，这里微调一下，把当前用户执行权限添加到相应的docker用户组里面。</p>
</blockquote>
<p><strong>步骤</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"># 添加一个新的docker用户组</div><div class="line">sudo groupadd docker</div><div class="line"># 添加当前用户到docker用户组里，注意这里的yongboy为ubuntu server登录用户名</div><div class="line">sudo gpasswd -a yongboy docker</div><div class="line"># 重启Docker后台监护进程</div><div class="line">sudo service docker restart</div><div class="line"># 重启之后，尝试一下，是否生效</div><div class="line">docker version</div><div class="line">#若还未生效，则系统重启，则生效</div><div class="line">sudo reboot</div></pre></td></tr></table></figure>
<h3 id="安装docker镜像">安装docker镜像</h3><ol>
<li><p>安装镜像</p>
<p> <code>docker pull learn/tutorial</code></p>
</li>
<li><p>测试效果</p>
<p> <code>docker run learn/tutorial /bin/echo hello world</code></p>
</li>
<li><p>进入虚拟机</p>
<p> <code>docker run -i -t learn/tutorial /bin/bash</code></p>
</li>
</ol>
<h3 id="虚拟机环境部署">虚拟机环境部署</h3><ol>
<li><p>安装ssh服务</p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">apt-get update</div><div class="line">apt-get install openssh-server</div><div class="line">which sshd</div><div class="line">/usr/sbin/sshd</div><div class="line">mkdir /var/run/sshd</div><div class="line">passwd #输入用户密码，我这里设置为123456，便于SSH客户端登陆使用</div><div class="line">exit #退出</div></pre></td></tr></table></figure>
</li>
<li><p>获取到刚才操作的实例容器ID</p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">#docker ps -l</div><div class="line">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES</div><div class="line">b5b8dd5e603e learn/tutorial:latest /bin/bash 3 minutes ago Exit 0 thirsty_pasteur</div></pre></td></tr></table></figure>
</li>
<li><p>状态保存</p>
<p> <code>docker commit b5b8dd5e603e learn/tutorial</code></p>
</li>
<li><p>以后台进程方式长期运行此镜像实例</p>
<p> <code>docker run -d -p 22 -p 800:8080 learn/tutorial /usr/sbin/sshd -D</code></p>
</li>
<li><p>查看实例运行状态</p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">wustrive@ubuntu:~$ sudo docker ps</div><div class="line">CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                                          NAMES</div><div class="line">b5b8dd5e603e        learn/tutorial      &quot;/usr/sbin/sshd -D&quot;   31 minutes ago      Up 31 minutes       0.0.0.0:32768-&gt;22/tcp, 0.0.0.0:800-&gt;8080/tcp   elegant_davinci</div></pre></td></tr></table></figure>
</li>
<li><p>ssh登录镜像</p>
<p> <code>ssh root@127.0.0.1 -p 32768</code></p>
</li>
<li><p>安装/运行javaweb部署运行环境</p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line"># 在ubuntu 12.04上安装oracle jdk 7</div><div class="line">apt-get install python-software-properties</div><div class="line">add-apt-repository ppa:webupd8team/java</div><div class="line">apt-get update</div><div class="line">apt-get install -y wget</div><div class="line">apt-get install oracle-java7-installer</div><div class="line">java -version</div><div class="line"># 下载tomcat 7.0.47</div><div class="line">wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.63/bin/apache-tomcat-7.0.63.tar.gz</div><div class="line"># 解压，运行</div><div class="line">tar xvf apache-tomcat-7.0.47.tar.gz</div><div class="line">cd apache-tomcat-7.0.47</div><div class="line">bin/startup.sh</div></pre></td></tr></table></figure>
</li>
<li><p>访问服务</p>
<p> 访问宿主主机800端口</p>
<p> 如：<code>curl http://192.168.32.151:800</code></p>
</li>
<li><p>保存镜像</p>
<p> <code>docker commit b5b8dd5e603e java/tomcat</code></p>
</li>
</ol>
<h3 id="docker常用命令">docker常用命令</h3><ul>
<li><p>docker version</p>
<p>  显示 Docker 版本信息。</p>
</li>
<li><p>docker info  </p>
<p>  检查docker安装是否正确</p>
</li>
<li><p>docker search</p>
<p>  从 Docker Hub 中搜索符合条件的镜像。</p>
<p>  —automated 只列出 automated build类型的镜像；</p>
<p>  —no-trunc 可显示完整的镜像描述；</p>
<p>  -s 40 列出收藏数不小于40的镜像。</p>
</li>
<li><p>sudo docker pull centos:7  </p>
<p>  从 Docker Hub 中拉取或者更新指定镜像。</p>
<p>  -a 拉取所有 tagged 镜像 。</p>
</li>
<li><p>docker images</p>
<p> 列出本地所有镜像。其中 [name] 对镜像名称进行关键词查询。</p>
<p> -a 列出所有镜像（含过程镜像）；</p>
<p> -f 过滤镜像，如： -f [‘dangling=true’] 只列出满足dangling=true 条件的镜像；</p>
<p> —no-trunc 可显示完整的镜像ID；</p>
<p> -q 仅列出镜像ID。</p>
<p> —tree 以树状结构列出镜像的所有提交历史。</p>
</li>
<li><p>docker run centos /bin/echo Hello Docker </p>
<p>  运行镜像</p>
</li>
<li><p>docker stop $sample_job</p>
<p>  停止名为sample_job的容器</p>
</li>
<li><p>docker commit $sample_job job1</p>
<p>  容器状态保存为镜像</p>
</li>
<li><p>docker ps</p>
<p>  列出所有运行中的容器</p>
<p>  -a 列出所有容器（含沉睡镜像）；</p>
<p>  —before=”nginx” 列出在某一容器之前创建的容器，接受容器名称和ID作为参数；</p>
<p>  —since=”nginx” 列出在某一容器之后创建的容器，接受容器名称和ID作为参数；</p>
<p>  -l 仅列出最新创建的一个容器；</p>
<p>  —no-trunc 显示完整的容器ID；</p>
<p>  -n=4 列出最近创建的4个容器；</p>
<p>  -q 仅列出容器ID；</p>
<p>  -s 显示容器大小。</p>
</li>
<li><p>docker rmi</p>
<p>  从本地移除一个或多个指定的镜像。</p>
<p>  -f 强行移除该镜像，即使其正被使用</p>
<p>  —no-prune 不移除该镜像的过程镜像，默认移除\</p>
</li>
<li><p>docker rm</p>
<p>  -f 强行移除该容器，即使其正在运行；</p>
<p>  -l 移除容器间的网络连接，而非容器本身；</p>
<p>  -v 移除与容器关联的空间。</p>
</li>
<li><p>docker history</p>
<p>  查看指定镜像的创建历史。</p>
<p>  —no-trunc 显示完整的提交记录；</p>
<p>  -q 仅列出提交记录ID。</p>
</li>
<li><p>docker start|stop|restart</p>
<p>  启动、停止和重启一个或多个指定容器。</p>
<p>  -a 待完成</p>
<p>  -i 启动一个容器并进入交互模式；</p>
<p>  -t 10 停止或者重启容器的超时时间（秒），超时后系统将杀死进程。</p>
</li>
<li><p>docker kill</p>
<p>  杀死一个或多个指定容器进程。</p>
<p>  -s “KILL” 自定义发送至容器的信号。</p>
</li>
<li><p>docker events</p>
<p>  从服务器拉取个人动态，可选择时间区间。</p>
</li>
<li><p>docker save</p>
<p>  将指定镜像保存成 tar 归档文件， docker load 的逆操作。保存后再加载（saved-loaded）的镜像不会丢失提交历史和层，可以回滚。</p>
</li>
<li><p>docker load</p>
<p>  从 tar 镜像归档中载入镜像， docker save 的逆操作。保存后再加载（saved-loaded）的镜像不会丢失提交历史和层，可以回滚。</p>
<p>  -i “debian.tar” 指定载入的镜像归档。</p>
</li>
<li><p>docker export</p>
<p>  将指定的容器保存成 tar 归档文件， docker import 的逆操作。导出后导入（exported-imported)）的容器会丢失所有的提交历史，无法回滚。</p>
</li>
<li><p>docker import</p>
<p>  从归档文件（支持远程文件）创建一个镜像， export 的逆操作，可为导入镜像打上标签。导出后导入（exported-imported)）的容器会丢失所有的提交历史，无法回滚。</p>
</li>
<li><p>docker top</p>
<p>  查看一个正在运行容器进程，支持 ps 命令参数。</p>
</li>
<li><p>docker inspect</p>
<p>  检查镜像或者容器的参数，默认返回 JSON 格式。</p>
<p>  -f 指定返回值的模板文件。</p>
</li>
<li><p>docker pause</p>
<p>  暂停某一容器的所有进程。</p>
</li>
<li><p>docker unpause</p>
<p>  恢复某一容器的所有进程。</p>
</li>
<li><p>docker tag</p>
<p>  标记本地镜像，将其归入某一仓库。</p>
<p>  -f 覆盖已有标记。</p>
</li>
<li><p>docker push</p>
<p>  将镜像推送至远程仓库，默认为 Docker Hub 。</p>
</li>
<li><p>docker logs</p>
<p>  获取容器运行时的输出日志。</p>
<p>  -f 跟踪容器日志的最近更新；</p>
<p>  -t 显示容器日志的时间戳；</p>
<p>  —tail=”10” 仅列出最新10条容器日志。</p>
</li>
<li><p>docker run</p>
<p>  启动一个容器，在其中运行指定命令。</p>
<p>  -a stdin 指定标准输入输出内容类型，可选 STDIN/STDOUT/STDERR 三项；</p>
<p>  -d 后台运行容器，并返回容器ID；</p>
<p>  -i 以交互模式运行容器，通常与 -t 同时使用；</p>
<p>  -t 为容器重新分配一个伪输入终端，通常与 -i 同时使用；</p>
<p>  —name=”nginx-lb” 为容器指定一个名称；</p>
<p>  —dns 8.8.8.8 指定容器使用的DNS服务器，默认和宿主一致；</p>
<p>  —dns-search example.com 指定容器DNS搜索域名，默认和宿主一致；</p>
<p>  -h “mars” 指定容器的hostname；</p>
<p>  -e username=”ritchie” 设置环境变量；</p>
<p>  —env-file=[] 从指定文件读入环境变量；</p>
<p>  —cpuset=”0-2” or —cpuset=”0,1,2” 绑定容器到指定CPU运行；</p>
<p>  -c 待完成</p>
<p>  -m 待完成</p>
<p>  —-net=”bridge” 指定容器的网络连接类型</p>
<p>  —link=[] 待完成</p>
<p>  —expose=[] 待完成</p>
</li>
</ul>
<h3 id="常见问题">常见问题</h3><ol>
<li>执行docker命令提示：</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Get http:///var/run/docker.sock/v1.19/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?</div></pre></td></tr></table></figure>
<p><strong>解决办法:</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">sudo apt-get install apparmor</div><div class="line"></div><div class="line">service docker restart</div></pre></td></tr></table></figure>
<ol>
<li>挂载宿主主机目录</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">docker run -it -v /home/dock/Downloads:/usr/Downloads ubuntu64 /bin/bash</div></pre></td></tr></table></figure>
  
	</div>
		<footer class="article-footer clearfix">

  <div class="article-tags">
  
  <span></span> <a href="/tags/Docker/">Docker</a><a href="/tags/Tomcat/">Tomcat</a><a href="/tags/Java/">Java</a><a href="/tags/Linux/">Linux</a><a href="/tags/虚拟机/">虚拟机</a>
  </div>


<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/Linux/">Linux</a>
</div>



<div class="article-share" id="share">

  <div data-url="https://wustrive2008.github.io/2015/07/26/Docker安装JavaWeb(Tomcat)运行环境/" data-title="Docker安装JavaWeb(Tomcat)运行环境 | wustrive&#39;s blog" data-tsina="null" class="share clearfix">
  </div>

</div>
</footer>   	       
	</article>
	
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2015/07/26/Linux/CentOS6.5下samba服务器搭建与配置/" title="CentOS6.5下samba服务器搭建与配置">
  <strong>PREVIOUS:</strong><br/>
  <span>
  CentOS6.5下samba服务器搭建与配置</span>
</a>
</div>


<div class="next">
<a href="/2015/07/26/缓存/memcached服务安装及使用/"  title="memcached高速缓存服务安装及使用">
 <strong>NEXT:</strong><br/> 
 <span>memcached高速缓存服务安装及使用
</span>
</a>
</div>

</nav>

	
<section class="comment">
	<div class="ds-thread"></div>
</section>

</div>  
      <div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">文章目录</strong>
  <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#安装docker"><span class="toc-number">1.</span> <span class="toc-text">安装docker</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#去除掉sudo"><span class="toc-number">2.</span> <span class="toc-text">去除掉sudo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#安装docker镜像"><span class="toc-number">3.</span> <span class="toc-text">安装docker镜像</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#虚拟机环境部署"><span class="toc-number">4.</span> <span class="toc-text">虚拟机环境部署</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#docker常用命令"><span class="toc-number">5.</span> <span class="toc-text">docker常用命令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#常见问题"><span class="toc-number">6.</span> <span class="toc-text">常见问题</span></a></li></ol>
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">分类</p>
		<ul>
		
			<li><a href="/categories/DB/" title="DB">DB<sup>1</sup></a></li>
		
			<li><a href="/categories/Linux/" title="Linux">Linux<sup>6</sup></a></li>
		
			<li><a href="/categories/UML/" title="UML">UML<sup>1</sup></a></li>
		
			<li><a href="/categories/cORc/" title="cORc++">cORc++<sup>1</sup></a></li>
		
			<li><a href="/categories/hexo/" title="hexo">hexo<sup>1</sup></a></li>
		
			<li><a href="/categories/http协议/" title="http协议">http协议<sup>2</sup></a></li>
		
			<li><a href="/categories/java/" title="java">java<sup>10</sup></a></li>
		
			<li><a href="/categories/js/" title="js">js<sup>1</sup></a></li>
		
			<li><a href="/categories/nginx/" title="nginx">nginx<sup>1</sup></a></li>
		
			<li><a href="/categories/python/" title="python">python<sup>2</sup></a></li>
		
			<li><a href="/categories/分享/" title="分享">分享<sup>1</sup></a></li>
		
			<li><a href="/categories/摘录/" title="摘录">摘录<sup>1</sup></a></li>
		
			<li><a href="/categories/版本控制/" title="版本控制">版本控制<sup>3</sup></a></li>
		
			<li><a href="/categories/算法/" title="算法">算法<sup>2</sup></a></li>
		
			<li><a href="/categories/缓存/" title="缓存">缓存<sup>1</sup></a></li>
		
			<li><a href="/categories/网络协议/" title="网络协议">网络协议<sup>1</sup></a></li>
		
			<li><a href="/categories/网络安全/" title="网络安全">网络安全<sup>1</sup></a></li>
		
			<li><a href="/categories/设计模式/" title="设计模式">设计模式<sup>2</sup></a></li>
		
			<li><a href="/categories/读书笔记/" title="读书笔记">读书笔记<sup>10</sup></a></li>
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">标签</p>
		<ul class="clearfix">
		
			<li><a href="/tags/Arraylist/" title="Arraylist">Arraylist<sup>1</sup></a></li>
		
			<li><a href="/tags/Centos/" title="Centos">Centos<sup>2</sup></a></li>
		
			<li><a href="/tags/DB/" title="DB">DB<sup>1</sup></a></li>
		
			<li><a href="/tags/Docker/" title="Docker">Docker<sup>1</sup></a></li>
		
			<li><a href="/tags/Email/" title="Email">Email<sup>1</sup></a></li>
		
			<li><a href="/tags/HashMap/" title="HashMap">HashMap<sup>1</sup></a></li>
		
			<li><a href="/tags/HotSpot/" title="HotSpot">HotSpot<sup>1</sup></a></li>
		
			<li><a href="/tags/IMAP/" title="IMAP">IMAP<sup>1</sup></a></li>
		
			<li><a href="/tags/Java/" title="Java">Java<sup>1</sup></a></li>
		
			<li><a href="/tags/Linux/" title="Linux">Linux<sup>5</sup></a></li>
		
			<li><a href="/tags/OOM/" title="OOM">OOM<sup>1</sup></a></li>
		
			<li><a href="/tags/POP3/" title="POP3">POP3<sup>1</sup></a></li>
		
			<li><a href="/tags/SMTP/" title="SMTP">SMTP<sup>1</sup></a></li>
		
			<li><a href="/tags/Tomcat/" title="Tomcat">Tomcat<sup>1</sup></a></li>
		
			<li><a href="/tags/UML/" title="UML">UML<sup>1</sup></a></li>
		
			<li><a href="/tags/aes/" title="aes">aes<sup>1</sup></a></li>
		
			<li><a href="/tags/array/" title="array">array<sup>1</sup></a></li>
		
			<li><a href="/tags/arraylist/" title="arraylist">arraylist<sup>1</sup></a></li>
		
			<li><a href="/tags/c/" title="c">c<sup>2</sup></a></li>
		
			<li><a href="/tags/chkconfig/" title="chkconfig">chkconfig<sup>1</sup></a></li>
		
		</ul>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello, I&#39;m wustrive. This is my blog on GitHub. <br/>
			I wish you happiness</p>
	</section>
	 
	<div class="social-font clearfix">
		
		<a href="http://weibo.com/12100106" target="_blank" title="weibo"></a>
		
		
		<a href="https://twitter.com/wustrive" target="_blank" title="twitter"></a>
		
		
		<a href="https://github.com/wustrive2008" target="_blank" title="github"></a>
		
		
		
	</div>
		<p class="copyright">Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/A-limon/pacman" target="_blank" title="Pacman">Pacman</a> © 2018 
		
		<a href="https://wustrive2008.github.io" target="_blank" title="wustrive">wustrive</a>
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else
    {
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      h  = $('article h2')
      ah = $('article h2'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  if(ah.length==0){
    t.css('display','none');
  }else{
    c.click(function(){
      ta.css('display', 'block').addClass('fadeIn');
    });
    o.click(function(){
      ta.css('display', 'none');
    });
    $(window).scroll(function(){
      ta.css("top",Math.max(140,320-$(this).scrollTop()));
    });
  };
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina');
  var html = [
  '<a href="#" class="overlay" id="qrcode"></a>',
  '<div class="qrcode clearfix"><span>扫描二维码分享到微信朋友圈</span><a class="qrclose" href="#share"></a><strong>Loading...Please wait</strong><img id="qrcode-pic" data-src="http://s.jiathis.com/qrcode.php?url=' + encodedUrl + '"/></div>',
  '<a href="#textlogo" class="article-back-to-top" title="Top"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="QRcode"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="Weibo"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);
  $('.article-share-qrcode').click(function(){
    var imgSrc = $('#qrcode-pic').attr('data-src');
    $('#qrcode-pic').attr('src', imgSrc);
    $('#qrcode-pic').load(function(){
        $('.qrcode strong').text(' ');
    });
  });
});     
</script>


<script type="text/javascript">
  var duoshuoQuery = {short_name:"wustrive"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 




<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-22190106-2', 'auto');  
ga('send', 'pageview');
</script>


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-22190106-2', 'auto');
  ga('send', 'pageview');

</script>

  </body>
</html>
